package com.xx.cloud.pay.config.pay;



import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class WxJavaConfig {

    /**
     * @return
     */
    // 公众号配置
    @Bean
    public WxMpConfigStorage wxMpConfig() {
        WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl();
        config.setAppId("wxf00177f");
        config.setSecret("85453154db62");
        config.setToken("111111");
        config.setOauth2redirectUri("http://e404e.natapp4.cc/wx/callback");
//        config.setAesKey("你的公众号EncodingAESKey"); // 如果需要的话
        return config;
    }



    @Bean
    public WxMpService wxMpService(WxMpConfigStorage config) {
        WxMpServiceImpl wxService = new WxMpServiceImpl();
        wxService.setWxMpConfigStorage(config);
        return wxService;
    }


}